<template>
  <div class="linkage">
    <div>
      <el-select v-model="item.categories"
                 default-first-option
                 filterable
                 multiple
                 value-key="categoryId"
                 style="width:600px"
                 placeholder="请选择精专方向">
<!--        <el-option label="请选择精专方向" value=""></el-option>-->
        <el-option v-for="item in categoryList" :key="item.categoryId" :label="item.categoryName" :value="item"></el-option>
      </el-select>
    </div>
  </div>
</template>

<script>
export default {
  name: "CategorySelector",
  props: ['item'],
  data() {
    return {
      categoryList:[],
    }
  },
  created() {
    this.$http.get('api/category/list').then(res =>{
      if (res.data.code===200){
        this.categoryList = res.data.data;
        // console.log('this.categoryList',this.categoryList)
      }
    })
  }
}
</script>

<style scoped>
.linkage {
  display: flex;
}

.linkage div {
  margin-right: 5px;
}
</style>